<extend name="Layout/ins_page" />
<block name="content">
	{:W('PageHeader/simple',array('name'=>'新建新联系人'))}
	<div class="sub-frame gray">
		<form method='post' id="form_data" >
			<input type="hidden" name="opmode" value="add">
			<input type="hidden" name="ajax" id="ajax" value="1">
			<div class="frame">
				<div class="bit-2">
					<div class="layui-form-item">
						<label class="layui-form-label" for="name">姓名*：</label>
						<div class="layui-input-block">
							<input class="layui-input" type="text" id="name" name="name" check="required" info="请输入姓名">
						</div>
					</div>
				</div>
				<div class="bit-2">
					<div class="layui-form-item">
						<label class="layui-form-label" for="company">公司：</label>
						<div class="layui-input-block">
							<input class="layui-input" type="text" id="company" name="company" >
						</div>
					</div>
				</div>
			</div>
			<div class="frame">
				<div class="bit-2">
					<div class="layui-form-item">
						<label class="layui-form-label" for="dept">部门：</label>
						<div class="layui-input-block">
							<input  class="layui-input" type="text" id="dept" name="dept">
						</div>
					</div>
				</div>
				<div class="bit-2">
					<div class="layui-form-item">
						<label class="layui-form-label" for="position">职位：</label>
						<div class="layui-input-block">
							<input  class="layui-input" type="text" id="position" name="position" >
						</div>
					</div>
				</div>
			</div>
			<div class="frame">
				<div class="bit-2">
					<div class="layui-form-item">
						<label class="layui-form-label" for="mobile_tel">手机：</label>
						<div class="layui-input-block">
							<input  class="layui-input" type="text" id="mobile_tel" name="mobile_tel" >
						</div>
					</div>
				</div>
				<div class="bit-2">
					<div class="layui-form-item">
						<label class="layui-form-label" for="office_tel">办公电话：</label>
						<div class="layui-input-block">
							<input  class="layui-input" type="text" id="office_tel" name="office_tel" >
						</div>
					</div>
				</div>

			</div>
			<div class="frame">
				<div class="bit-2">
					<div class="layui-form-item">
						<label class="layui-form-label" for="email">邮件：</label>
						<div class="layui-input-block">
							<input class="layui-input" type="text" id="email" name="email" >
						</div>
					</div>
				</div>
				<div class="bit-2">
					<div class="layui-form-item">
						<label class="layui-form-label" for="im">即时聊天：</label>
						<div class="layui-input-block">
							<input class="layui-input" type="text" id="im" name="im" >
						</div>
					</div>
				</div>
			</div>
			<div class="frame">
				<div class="bit-2">
					<div class="layui-form-item">
						<label class="layui-form-label" for="address">地址：</label>
						<div class="layui-input-block">
							<input  class="layui-input" type="text" id="address" name="address" >
						</div>
					</div>
				</div>
				<div class="bit-2">
					<div class="layui-form-item">
						<label class="layui-form-label" for="website">网址：</label>
						<div class="layui-input-block">
							<input  class="layui-input" type="text" id="website" name="website">
						</div>
					</div>
				</div>
			</div>
			<div class="frame">
				<div class="bit-1">
					<div class="layui-form-item">
						<label class="layui-form-label" for="remark" >其他：</label>
						<div class="layui-input-block" >
							<textarea class="layui-textarea" id="remark" name="remark" rows="5" class="col-xs-12" ></textarea>
						</div>
					</div>
				</div>
				<div class="bit-1">
					<div class="layui-form-item">
						<div class="layui-input-block">
							<input class="btn" type="button" value="保存" id="btn_save">
							<input class="btn btn-cancel" type="button" value="取消" onclick="go_return_url();">
						</div>
					</div>
				</div>
			</div>
		</form>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		layui.use(['global', 'uploader'], function() {
			var $ = layui.jquery;
			
			$("#btn_save").on('click', function() {
				send_form("form_data", "{:U('save')}", "{:U('index')}", function(ret) {
					if (ret.status) {
						layer.msg(ret.info);
						location.href = "{:U('index')}";
					} else {
						layer.msg(ret.info);
						return false;
					}
				});
			});
			

			$("#salesman").suggest({
				url : "{:U('get_salesman_list')}",
				callback : function(ret) {
					if (ret.status == 1) {
						$('#salesman_id').val(ret.data.key);
						$('#salesman_name').val(ret.data.val);
						$('#salesman').val(ret.data.val);
					}
				}
			});

			$("#company").suggest({
				url : "{:U('get_compnay_list')}",
				callback : function(ret) {
					if (ret.status == 1) {
						$('#company_id').val(ret.data.key);
						$('#company_name').val(ret.data.val);
						$('#company').val(ret.data.val);
					}
				}
			});			
		});
	</script>
</block>